package com.frogs.ucenter.service;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.frogs.ucenter.entity.UserShippingAddress;

public interface UserShippingAddressService {

	/**
	 * 查询用户送货地址
	 * @param pageNo
	 * @param pageSize
	 * @param userId
	 * @return
	 */
	JSONObject getUserAddressList(Integer pageNo, Integer pageSize,
			Integer userId) throws Exception;
	
	/**
	 * 查询用户送货地址并解析成List
	 * @param pageNo
	 * @param pageSize
	 * @param userId
	 * @return
	 */
	List<UserShippingAddress> getUserAddressListForList(Integer pageNo, Integer pageSize,
			Integer userId) throws Exception;

	/**
	 * 修改送货地址
	 * @param userId
	 * @param userAddressId
	 * @return
	 */
	JSONObject updateUserAddress(Integer userId, UserShippingAddress userShippingAddress) throws Exception;
	
	/**
	 * 修改用户默认地址项，若用户没有设置默认地址，则添加，否则修改原默认地址记录
	 * @param userId
	 * @param addressId
	 * @param areaId
	 * @param province
	 * @param city
	 * @param district
	 * @return
	 */
	JSONObject mergeUserDefaultAddress(Integer userId, Integer addressId, String areaId, String province, String city, String district, String phone) throws Exception;	
	
	/**
	 * 新增送货地址
	 * @param userId
	 * @param address
	 * @return
	 */
	JSONObject addUserAddress(Integer userId, UserShippingAddress userShippingAddress) throws Exception;

	/**
	 * 显示某个送货地址内容
	 * @param userId
	 * @param userAddressId
	 * @return
	 */
	JSONObject showUserAddress(Integer userId, Integer userAddressId) throws Exception;
	
	/**
	 * 删除某个送货地址
	 * @param userId
	 * @param userAddressId
	 * @return
	 */
	JSONObject deleteUserAddress(Integer userId, Integer userAddressId) throws Exception;
	
	/**
	 * 设置默认送货地址
	 * @param userId
	 * @param userAddressId
	 * @return
	 */
	JSONObject defaultUserAddress(Integer userId, Integer userAddressId) throws Exception;
	
	/**
	 * 根据手机号码获取收货地址
	 * @param userId
	 * @param phone
	 * @return
	 */
	JSONObject getAddressByPhone(Integer userId, String phone) throws Exception;
	
}
